feat: Do not try compiling tests of types during linting#141
feat: Do not try compiling tests of types during linting#141Lukas-Kullmann wants to merge 1 commit intokentcdodds:masterfrom Lukas-Kullmann:pr/do-not-lint-type-tests
Conversation
Codecov Report
@@ Coverage Diff @@
## master #141 +/- ##
=======================================
Coverage 87.65% 87.65%
=======================================
Files 18 18
Lines 332 332
Branches 78 78
=======================================
Hits 291 291
Misses 34 34
Partials 7 7
Continue to review full report at Codecov.
|
|
Thanks for this! Is there any way to just get tsc to ignore a glob rather than simply not running tsc on the files? I'd like to eventually be able to run |
|
Yes. You can add the files to the exclude section of the tsconfig file. You would add the file (or folder) to that exclude section and pass the file to the tsc call. The problem with that specific project (dom testing library) is that the tsconfig file is not in the root folder. So I don't know a good heuristic to determine the location of the tsconfig. In projects written entirely in typescript, it would be in the root folder, in other projects it would be in a specific subfolder only. So I'm not sure how to do that. Would requiring a tsconfig in the root of the project be too much of a requirement for projects like dom testing library (that only wants to provide some types for the otherwise pure js codebase)? |
|
Yeah, I'm ok with moving the tsconfig.json to the root in dom-testing-library and just requiring that for everyone. With that in mind, I think we can probably close this PR (sorry about the trouble, thanks for taking the time) and instead just move the tsconfig.json. |
What:
Removed compiling of types tests during linting.
Why:
Type tests could contain "negative" tests (i.e. dtslint's
$ExpectError). See testing-library/dom-testing-library#572 for more context.How:
I changed the globs to not include the files in
types/__tests__. Unfortunately, I had to split up the glob into two since micromatch does not support testing for multiple consecutive directories.Checklist: